随笔分类 - vue
摘要:1.ref实现,要写在mounted里面 <input type="text" v-model="name" ref="getFocus" /> <script> export default { data() { return { name: '' } }, mounted() { this.$r
阅读全文
摘要:1.下载 npm install echarts --save 2.在main.js中引入 import echarts from 'echarts' Vue.prototype.$echarts = echarts 3.使用 <div id="map" style="width: 100%;hei
阅读全文
摘要:1.在vue中,使用watch来响应数据的变化 <input type="text" v-model="userName" /> data() { return { userName: "wuHen", }; }, watch: { userName(newName, oldName) { cons
阅读全文
摘要:1.在项目根目录建立vue.config.js module.exports = { publicPath: "./", // 公共路径(必须有的) outputDir: "dist", // 输出文件目录 assetsDir: "static", //静态资源文件名称 lintOnSave: fa
阅读全文
摘要:import Vue from "vue"; import router from "../../src/router/index"; import axios from "axios"; // 请求拦截 axios.interceptors.request.use( config => { con
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:1.下载 npm install --save vuex-persistedstate 2.在vuex里面引入,默认是localStorage import persistedState from 'vuex-persistedstate' export default new Vuex.Store
阅读全文
摘要:1.安装 npm install --save vue-clipboard2 2.在main.js中引入 import VueClipboard from 'vue-clipboard2' Vue.use(VueClipboard) 3.1方法一(复制链接“https://www.cnblogs.c
阅读全文

浙公网安备 33010602011771号