关于this.$XXXXXXX
一般在vue中,这些$的都是一个全局对象,这些都会在main.js中进行全局引用。如下所示main.js文件。
1.this.$router :vue-router路由,import router from ‘./router/’。
2.this.$toast :vant有赞移动端ui的一个“轻提示”组件,import { Toast, Dialog } from ‘vant’;。
import Vue from 'vue'
import App from './App.vue'
import router from './router/'
import store from './store/'import { Toast, Dialog } from 'vant';
Vue.use(Toast);
Vue.use(Dialog);import { Tree } from 'iview';
Vue.component('Tree', Tree);Vue.config.productionTip = false;Vue.prototype.getMallId = function(){const mallid = localStorage.getItem('mid');if (mallid){return mallid;}else{router.push({path: '/login'})return false}
}new Vue({router,store,render: h => h(App)
}).$mount('#app')
使用方法:
this.$toast(‘请选择地址’);
this.$toast(‘请选择规格’);
this.$toast(‘库存不足’);等
关于this.$XXXXXXX相关推荐
- oracle 提示:ORA-02292:integrity constraint(xxxxxxx) violated - child record found
当我们删除 数据的时候 oracle 提示:ORA-02292:integrity constraint(xxxxxxx) violated - child record found 这种情况呢是因为 ...
- git reset --hard xxxxxxx
关于git reset --hard xxxxxxx命令之Git版本回退 今晚代码写着写着就头脑有点发懵,手指也不听使唤了竟然让我敲出了 git reset --hard 命令,然后的然后就是之前所有 ...
- error C2504: “XXXXXXX”: 未定义基类
今天犯到了一个低级错误,记下来加深印象. 造成这一现象主要的原因是头文件相互包含,文件构成一个环形结构,从而编译时循环包含出错 如: AA.h中包含BB.h BB.h中包含CC.h CC.h中包含AA ...
- Git提交数据失败 error: failed to push some refs to 'https://github.com/XXXXXXX/gif.git'
附载码云的使用教程地址:http://www.jianshu.com/p/084e0aabbab3 问题一:执行Git remote add origin https://github.com/XXX ...
- 全网 Vue 最XXXXXXX...... 男人看了沉默,女人看了流泪
xxxx全网 Vue 最XXXXXXX...... 男人看了沉默,女人看了流泪 <dir id="app"><ul><li v-for="( ...
- Python 学习笔记 元组 xxxxxxx XXXXXXXXXX
Python 学习笔记 元组 xxxxxxx XXXXXXXXXX print("=" * 20) dimensions = (200, 50) print(dimensions[ ...
- 关于Navicat连接mysql数据库报host XXXXXXX is not allowed to connect to this mysql server
服务器重新做了一个系统.然后安装mysql(这一系列应该都是做完才搜索这个问题的,我就不废话了),使用本地的Navicat进行连接就报了一个host XXXXXXX is not allowed to ...
- PowerShell:无法加载文件 XXXXXXX,因为在此系统上禁止运行脚本
问题背景 运行Windows PowerShell(或者是VSCode Debuggable Package Manager)的时候出现了几行红字(类似问题也都差不多都是无法运行脚本) . : 无法加 ...
- Android:访问存储失败.FileNotFoundException open failed: XXXXXXX EPERM (Operation not permitted)
Android:访问存储失败.FileNotFoundException open failed: XXXXXXX EPERM (Operation not permitted) 设备/引擎:Mac( ...
- Blocked a frame with origin “https://my.xxxxxxx.com“ from accessing a cross-origin frame.
最近在写一个项目:需要在页面使用iframe来做登陆功能,本想使用parent.window.location.reload();刷新页面的,最后报错了"Blocked a frame wi ...
最新文章
- Conda 为什么越来越慢?
- Microsoft COCO 数据集
- 2021年传感器行业的机遇与风险 | 深度思考
- 如何将RDS的数据同步到本地自建数据库
- MySQL中的行级锁,表级锁,页级锁
- CommonJS规范(转)
- BZOJ 1552/1506 [Cerc2007]robotic sort
- 【Java】探究Java数组的本质
- Xcode7 出现-fembed-bitcode错误的解决办法
- memcache的资料集
- MYSQL 二进制还原
- 超轻量级Web安全漏洞扫描工具Netsparker使用教程介绍
- IT技术支持必备知识
- Android的第一行代码
- Altium Designer入门与进阶教程系列
- 高频交揭密美五大高交商访谈录
- Spring Boot:The field file exceeds its maximum permitted size of 1048576 bytes.
- linux磁盘介绍及磁盘分区
- 立体栅格地图_具有立体效果的地图制作
- cesium添加天地图,从环境配置到加载天地图