随笔分类 -  vue

摘要:1.ref实现,要写在mounted里面 <input type="text" v-model="name" ref="getFocus" /> <script> export default { data() { return { name: '' } }, mounted() { this.$r 阅读全文
posted @ 2020-11-05 14:29 无痕-范特西 阅读(2093) 评论(0) 推荐(0)
摘要:1.下载 npm install echarts --save 2.在main.js中引入 import echarts from 'echarts' Vue.prototype.$echarts = echarts 3.使用 <div id="map" style="width: 100%;hei 阅读全文
posted @ 2020-09-19 14:01 无痕-范特西 阅读(5897) 评论(2) 推荐(1)
摘要:1.在vue中,使用watch来响应数据的变化 <input type="text" v-model="userName" /> data() { return { userName: "wuHen", }; }, watch: { userName(newName, oldName) { cons 阅读全文
posted @ 2020-07-28 10:59 无痕-范特西 阅读(454) 评论(0) 推荐(0)
摘要:1.在项目根目录建立vue.config.js module.exports = { publicPath: "./", // 公共路径(必须有的) outputDir: "dist", // 输出文件目录 assetsDir: "static", //静态资源文件名称 lintOnSave: fa 阅读全文
posted @ 2020-07-22 15:30 无痕-范特西 阅读(3355) 评论(0) 推荐(0)
摘要:import Vue from "vue"; import router from "../../src/router/index"; import axios from "axios"; // 请求拦截 axios.interceptors.request.use( config => { con 阅读全文
posted @ 2020-07-16 17:00 无痕-范特西 阅读(810) 评论(0) 推荐(0)
摘要:1.下载 npm install vue-socket.io --save 2.在main.js中引入 import VueSocketIO from "vue-socket.io"; import SocketIO from "socket.io-client"; Vue.prototype.So 阅读全文
posted @ 2020-07-05 15:04 无痕-范特西 阅读(4064) 评论(1) 推荐(0)
摘要:1.下载 npm install vue-i18n 2.创建中英文包 2.1 中文包 2.2英文包 3.在main里面引入 import VueI18n from "vue-i18n"; Vue.use(VueI18n); const i18n = new VueI18n({ locale: loc 阅读全文
posted @ 2020-05-31 22:35 无痕-范特西 阅读(361) 评论(0) 推荐(0)
摘要:1.下载 npm install --save vuex-persistedstate 2.在vuex里面引入,默认是localStorage import persistedState from 'vuex-persistedstate' export default new Vuex.Store 阅读全文
posted @ 2020-05-31 19:06 无痕-范特西 阅读(2151) 评论(0) 推荐(0)
摘要:1.安装 npm install --save vue-clipboard2 2.在main.js中引入 import VueClipboard from 'vue-clipboard2' Vue.use(VueClipboard) 3.1方法一(复制链接“https://www.cnblogs.c 阅读全文
posted @ 2020-04-28 21:50 无痕-范特西 阅读(1862) 评论(1) 推荐(0)