随笔分类 - Vue
摘要:Navigation is triggered using Vue Router when a <router-link> is clicked, but also can be triggered programmatically from inside our code. In this les
阅读全文
摘要:Often when building web applications we need to be able to perform multiple actions (View, Edit, Register) for a single resource (Event). Each URL pro
阅读全文
摘要:As our application evolves, we may need to change the URL paths of where our pages initially found. There are two convenience methods for this: ⚠️ Pro
阅读全文
摘要:Problem: How do we read query parameters off the URL? For example, often when we write pagination, we might have a URL that looks like this: http://ex
阅读全文
摘要:Need to follow some rules: Each folder should has a page.js configuration to save the meta data. // page.js export default { title: "About", menuOrder
阅读全文
摘要:It is not good to import axios from each Components or different services, because it will create a new instance of axios everytime. import axios from
阅读全文
摘要:Sometime when doing thing is harder in template syntax, you can switch to using render function intead. For example, we have s Stackcomponent, it dyna
阅读全文
摘要:For component level authority controls, we need to find a common partten so that we can extract a common component to handle the permission control in
阅读全文
摘要:export enum EffectFlags { /** * ReactiveEffect only */ ACTIVE = 1 << 0, RUNNING = 1 << 1, TRACKING = 1 << 2, NOTIFIED = 1 << 3, DIRTY = 1 << 4, ALLOW_
阅读全文
摘要:import {computed} from "vue" export function useComputed(fn) { const map = new Map() return function(...args) { const key = JSON.stringify(args); if (
阅读全文
摘要:<template> <div> count: {{ count }} </div> <div> doubled: {{ doubledCount }} </div> <button @click="increase">increase</button> </template> <script se
阅读全文
摘要:how to encapsulate second time of ui components For example we have follow code, with one UI component MyInput // App.vue <template> <div> <MyInput></
阅读全文
摘要:We often see circular dependency, why it's a problem, why we should avoid it and hwo to avoid it? Let's see any example first // main.js import A from
阅读全文
摘要:Let's say we have a Vue application that renders many heavy components on the first load. The problem we're facing is a long white screen period while
阅读全文
摘要:One way data binding, the parent component pasing data through v-modelto child component, if child modify the data, v-modelwill take care emit the cha
阅读全文
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
摘要:Even by using modules, they still share the same namespace. So you couldn’t have the same mutation name in different modules. Namespaces solve that by
阅读全文
摘要:Sometimes we need to create modules at runtime, for example depending on a condition. We could even want to lazy load that module by using Webpack’s c
阅读全文
摘要:When the Vuex store grows, it can have many mutations, actions and getters, belonging to different contexts. Vuex allows you to split your store into
阅读全文