随笔分类 -  vue

摘要:安装 cnpm install axios 使用 import axios from 'axios' axios({ method: 'get', url: 'http://123.207.32.32:8000/home/multidata' }).then(res => { console.log 阅读全文
posted @ 2021-07-15 16:58 thomas_blog 阅读(83) 评论(0) 推荐(0) 编辑
摘要:不同于mutations,actions可以处理异步操作 index.js import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) const store = new Vuex.Store({ state: { name: 'furon 阅读全文
posted @ 2021-07-14 19:56 thomas_blog 阅读(572) 评论(0) 推荐(0) 编辑
摘要:<p>square: {{$store.getters.squareCount}}</p> index.js import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) const store = new Vuex.Store({ stat 阅读全文
posted @ 2021-07-14 19:03 thomas_blog 阅读(30) 评论(0) 推荐(0) 编辑
摘要:index.js import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) const store = new Vuex.Store({ state: { count: 100 }, mutations: { countAdd(state 阅读全文
posted @ 2021-07-14 11:38 thomas_blog 阅读(78) 评论(0) 推荐(0) 编辑
摘要:下载源码编译 谷歌浏览器加载 使用 阅读全文
posted @ 2021-07-14 11:18 thomas_blog 阅读(67) 评论(0) 推荐(0) 编辑
摘要:index.js import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) const store = new Vuex.Store({ state: { count: 100 }, mutations: { }, actions: { 阅读全文
posted @ 2021-07-14 10:28 thomas_blog 阅读(32) 评论(0) 推荐(0) 编辑
摘要:所有执行完成后,回调 Promise.all([ new Promise(resolve => { setTimeout(() => { console.log('furong'); resolve({ name: 'furong', age: 12 }); }, 2000) }), new Pro 阅读全文
posted @ 2021-07-13 14:08 thomas_blog 阅读(77) 评论(0) 推荐(0) 编辑
摘要:new Promise((resolve) => { var a = 1; resolve(a); }).then((data) => { console.log(data); return data + 1; }).then((data) => { console.log(data); }) 阅读全文
posted @ 2021-07-13 13:44 thomas_blog 阅读(214) 评论(0) 推荐(0) 编辑
摘要:resolve new Promise((resolve, reject) => { setTimeout(() => { console.log('one'); }, 2000) resolve("resolve"); }).then((data) => { console.log(data); 阅读全文
posted @ 2021-07-13 12:24 thomas_blog 阅读(158) 评论(0) 推荐(0) 编辑
摘要:resolve: { extensions: ['.js', '.vue', '.json'], alias: { 'vue$': 'vue/dist/vue.esm.js', '@': resolve('src'), } }, 使用 import HelloWorld from '@/compon 阅读全文
posted @ 2021-07-13 11:14 thomas_blog 阅读(122) 评论(0) 推荐(0) 编辑
摘要:匹配的组件会被缓存 <template> <div id="app"> <img src="./assets/logo.png"> <router-link to="/Quange">Quange</router-link> <router-link to="/Furong">Furong</rou 阅读全文
posted @ 2021-07-09 15:12 thomas_blog 阅读(66) 评论(0) 推荐(0) 编辑
摘要:被包含的组件保留状态,避免重新渲染 Furong.vue <template> <div id="Furong"> <p>{{msg}}</p> <p>{{userInfo}}</p> </div> </template> <script> export default { name: 'Furon 阅读全文
posted @ 2021-07-09 15:07 thomas_blog 阅读(42) 评论(0) 推荐(0) 编辑
摘要:main.js // The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. im 阅读全文
posted @ 2021-07-09 14:32 thomas_blog 阅读(103) 评论(0) 推荐(0) 编辑
摘要:Quange.vue <template> <div id="Quange"> <p>{{msg}}</p> <button type="button" @click="onClick">跳转</button> </div> </template> <script> export default { 阅读全文
posted @ 2021-07-08 17:35 thomas_blog 阅读(194) 评论(0) 推荐(0) 编辑
摘要:App.vue <template> <div id="app"> <img src="./assets/logo.png"> <router-link to="/Quange/" tag="button">Quange</router-link> <router-link :to="args">F 阅读全文
posted @ 2021-07-08 17:27 thomas_blog 阅读(158) 评论(0) 推荐(0) 编辑
摘要:export default new Router({ routes: [{ path: '/', name: 'HelloWorld', component: HelloWorld, children: [{ path: '/Furong/:id', name: 'Furong', compone 阅读全文
posted @ 2021-07-08 16:40 thomas_blog 阅读(31) 评论(0) 推荐(0) 编辑
摘要:// import Furong from '@/components/Furong' // import Quange from '@/components/Quange' const Quange = () => import('@/components/Quange') const Furon 阅读全文
posted @ 2021-07-08 15:59 thomas_blog 阅读(33) 评论(0) 推荐(0) 编辑
摘要:动态id index.js export default new Router({ routes: [{ path: '/Furong/:id', name: 'Furong', component: Furong }, }) App.vue <template> <div id="app"> <i 阅读全文
posted @ 2021-07-08 15:30 thomas_blog 阅读(134) 评论(0) 推荐(0) 编辑
摘要:Quange.vue <template> <div id="Quange"> <p>{{msg}}</p> <button type="button" @click="onClick">跳转</button> </div> </template> <script> export default { 阅读全文
posted @ 2021-07-08 14:35 thomas_blog 阅读(52) 评论(0) 推荐(0) 编辑
摘要:<!-- 渲染成button --> <router-link to="/Quange" tag="button">Quange</router-link> <!-- 取消返回效果 --> <router-link to="/Furong" replace="">Furong</router-lin 阅读全文
posted @ 2021-07-08 14:32 thomas_blog 阅读(20) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示