How to use the vant.Toast.name function in vant

To help you get started, we’ve selected a few vant examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github czero1995 / fancy-store / src / views / category / Category.vue View on Github external
},
    data() {
        return {
            menuList: [],
            categoryList: [],
            categoryContent: [],
            pageNum: 0,
            type: ""
        };
    },
    mixins: [dataMixin],
    components: {
        [NavBar.name]: NavBar,
        [Tab.name]: Tab,
        [Tabs.name]: Tabs,
        [Toast.name]: Toast,
        [Icon.name]: Icon
    },
    computed: {},

    mounted() {
        this.getMenuList();
        // this.getCategoryList();
    },
    methods: {
        async getMenuList() {
            let res = await apiGetCategoryMenu();
            this.menuList = res.data.data.slice(1);
            console.log("menuList: ", this.menuList);
            this.type = this.menuList[0].title;
            this.getCategoryList();
        },
github czero1995 / fancy-store / src / views / member / Info.vue View on Github external
],
            uploadToken: {
                token: ""
            },
            coverJoinUrl: "",
            apiParams: {},
            sex: "",
            domain: ""
        };
    },
    components: {
        [NavBar.name]: NavBar,
        [Cell.name]: Cell,
        [CellGroup.name]: CellGroup,
        [Actionsheet.name]: Actionsheet,
        [Toast.name]: Toast
    },
    mounted() {
        this.getUser();
    },
    methods: {
        onRead(file) {
            console.log(file);
            this.$refs.avatar.src = file.content;
            let data = new FormData();
            data.append("token", this.uploadToken.token);
            data.append("file", file.content);
            const axiosInstance = axios.create({ withCredentials: false });
            console.log("data: ", data);
            axiosInstance({
                method: "POST",
                url: "http://upload.qiniu.com/", //上传地址
github linlinjava / litemall / litemall-vue / src / views / order / checkout.vue View on Github external
}
      else{
        const couponId = this.coupons[index].cid;
        const userCouponId = this.coupons[index].id;
        setLocalStorage({CouponId: couponId, UserCouponId: userCouponId});
      }

      this.init()
    },
    onExchange() {
      this.$toast("兑换暂不支持");
    }    
  },

  components: {
    [Toast.name]: Toast ,
    [SubmitBar.name]: SubmitBar,
    [Card.name]: Card,
    [Field.name]: Field,
    [Tag.name]: Tag,
    [CouponCell.name]: CouponCell,
    [CouponList.name]: CouponList,
    [Popup.name]: Popup
  }
};
github czero1995 / fancy-store / src / views / product / Product.vue View on Github external
};
    },
    data() {
        return {
            pageNum: 0,
            bannerList: [],
            productList: [],
            isLoading: false
        };
    },
    components: {
        [NavBar.name]: NavBar,
        [Swipe.name]: Swipe,
        [SwipeItem.name]: SwipeItem,
        [PullRefresh.name]: PullRefresh,
        [Toast.name]: Toast,
        [Icon.name]: Icon
    },
    mounted() {
        this.getBannerList();
        this.getProductData();
    },

    methods: {
        async getProductData() {
            let res = await apiGetProduct(this.pageNum, "热门");
            this.productList = res.data.data;
            this.isLoading = false;
        },
        onRefresh() {
            this.pageNum = 0;
            this.getProductData();
github czero1995 / fancy-store / src / views / cart / Cart.vue View on Github external
radioArr: [],
            itemIndex: "",
            cartsData: [],
            checked: true,
            showEdit: false
        };
    },
    mixins: [dataMixin],
    components: {
        [NavBar.name]: NavBar,
        [Checkbox.name]: Checkbox,
        [CheckboxGroup.name]: CheckboxGroup,
        [SubmitBar.name]: SubmitBar,
        [Icon.name]: Icon,
        [Dialog.name]: Dialog,
        [Toast.name]: Toast
    },

    created() {
        this.getCart();
    },
    mounted() {},
    methods: {
        async getCart() {
            let res = await apiGetCart();
            if (res.data.code == -1) {
                this.title = this.$t("m.login.noLogin");
                setTimeout(() => {
                    this.$refs.nopage.onDisplay();
                    this.$refs.nopage.onLogin();
                }, 300);
                return;
github czero1995 / fancy-store / src / views / order / Order.vue View on Github external
return {
            havePage: false,
            orderData: [],
            type: "paying",
            active: 0,
            orderTab: [{ name: this.$t("m.order.paying") }, { name: this.$t("m.order.waitPack") }, { name: this.$t("m.order.done") }, { name: this.$t("m.order.all") }],
            title: "",
            showEdit: false
        };
    },
    mixins: [dataMixin],
    components: {
        [NavBar.name]: NavBar,
        [Tab.name]: Tab,
        [Tabs.name]: Tabs,
        [Toast.name]: Toast,
        [Icon.name]: Icon,
        [Tag.name]: Tag,
        [Dialog.name]: Dialog
    },
    computed: {
        ...mapGetters(["this.$store.state.orderStatus"])
    },
    created() {
        switch (this.$store.state.orderStatus) {
            case "paying":
                this.active = 0;
                this.type = "paying";
                break;
            case "payed":
                this.active = 1;
                this.type = "payed";
github czero1995 / fancy-store / src / views / address / AddAddress.vue View on Github external
state: "add"
        };
    },
    computed: {
        ...mapGetters(["this.$store.state.addressStatus"])
    },
    components: {
        [NavBar.name]: NavBar,
        [Area.name]: Area,
        [Field.name]: Field,
        [Dialog.name]: Dialog,
        [SwitchCell.name]: SwitchCell,
        [Cell.name]: Cell,
        [CellGroup.name]: CellGroup,
        [Icon.name]: Icon,
        [Toast.name]: Toast
    },
    created() {
        this.areaList = areaList;
        if (this.$route.query.state == "edit") {
            let data = this.$route.query.item;
            this.addressInfo = data;
            this.title = this.$t("editAddressTitle");
            this.state = "edit";
        }
    },
    mounted() {},

    methods: {
        onAddress() {
            this.showArea = !this.showArea;
        },
github czero1995 / fancy-store / src / views / order / OrderWait.vue View on Github external
productId: [],
            addressData: [],
            orderData: [],
            addressInfo: {}
        };
    },
    components: {
        [NavBar.name]: NavBar,
        [Dialog.name]: Dialog,
        [Popup.name]: Popup,
        [Card.name]: Card,
        [SubmitBar.name]: SubmitBar,
        [Cell.name]: Cell,
        [CellGroup.name]: CellGroup,
        [ContactList.name]: ContactList,
        [Toast.name]: Toast
    },
    computed: {
        cardType() {
            return this.chosenContactId !== null ? "edit" : "add";
        },

        currentContact() {
            const id = this.chosenContactId;
            return id !== null ? this.list.filter(item => item.id === id)[0] : {};
        },
        ...mapGetters(["this.$store.state.orders", "this.$store.state.address", "this.$store.state.addressStatus"])
    },
    created() {},
    mounted() {
        this.getAddress();
        if (this.$route.query.status == "todo") {
github linlinjava / litemall / litemall-vue / src / views / home / tabbar-home.vue View on Github external
query: { itemClass: categoryId }
        });
      });
    },
    initViews() {
      getHome().then(res => {
        this.shopInfos = res.data.data;
      });
    }
  },

  components: {
    [Row.name]: Row,
    [Col.name]: Col,
    [Card.name]: Card,
    [Toast.name]: Toast,
    [CouponCell.name]: CouponCell,
    [CouponList.name]: CouponList,
    [Search.name]: Search,
    [Panel.name]: Panel,
    [List.name]: List,
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem,
    [Tabbar.name]: Tabbar,
    [TabbarItem.name]: TabbarItem,
    [Tag.name]: Tag,
    [Grid.name]: Grid,
    [GridItem.name]: GridItem
  }
};
github czero1995 / fancy-store / src / views / member / Login.vue View on Github external
content: this.$t("m.meta.login.content")
                }
            ]
        };
    },
    data() {
        return {
            userAccount: "guest",
            userPasswd: "guest"
        };
    },
    components: {
        [NavBar.name]: NavBar,
        [Cell.name]: Cell,
        [CellGroup.name]: CellGroup,
        [Toast.name]: Toast,
        [Button.name]: Button,
        [Field.name]: Field
    },
    mounted() {},
    methods: {
        async onLogin() {
            const userAccountEmpty = strategies.isNonEmpty(this.userAccount, this.$t("m.strategies.name"));
            const userPasswdLength = strategies.isNonEmpty(this.userPasswd, 4, this.$t("m.strategies.pwdLenth"));
            const result = userAccountEmpty || userPasswdLength;
            if (result) {
                Toast({
                    message: result,
                    position: "bottom"
                });
            } else {
                let res = await apiLogin(this.userAccount, this.userPasswd);