摘要: Because Nuxt renders pages on the server, you should use the nuxt-link components to navigate between pages. Each time a page loads, you can check if 阅读全文
posted @ 2017-07-24 20:12 Zhentiw 阅读(439) 评论(0) 推荐(0)
摘要: In a server-rendered application, if you attempt to load data before the page renders and the data fails to load, your application will not run unless 阅读全文
posted @ 2017-07-24 19:47 Zhentiw 阅读(294) 评论(0) 推荐(0)
摘要: You add array of todos to the store simply by adding them to the state defined in your store/index.js file. You can access the array of todos using ma 阅读全文
posted @ 2017-07-24 18:10 Zhentiw 阅读(236) 评论(0) 推荐(0)
摘要: You can easily add CSS libraries to Nuxt using yarn or npm to install them, then simply adding them to the nuxt.config.js so they're included in each 阅读全文
posted @ 2017-07-24 17:57 Zhentiw 阅读(286) 评论(0) 推荐(0)
摘要: You commit changes to state in Vuex using defined mutations. You can easily access these state mutations in your template using mapMutations. This les 阅读全文
posted @ 2017-07-24 15:59 Zhentiw 阅读(337) 评论(0) 推荐(0)
摘要: Install: Init project: Run: Create a index.js file inside store folder: Display the counter inside pages/index.vue: mapState: return a state tree obje 阅读全文
posted @ 2017-07-24 15:33 Zhentiw 阅读(220) 评论(0) 推荐(0)
摘要: We can use 'type' keyword to define a function type. 'digitValidators', is a mapping object, return a function which type is DigitValidator. 阅读全文
posted @ 2017-07-24 02:41 Zhentiw 阅读(469) 评论(0) 推荐(0)
摘要: We can use 'setSelectionRange(start, end)' to set cursor postion, in which start postion = end position. 阅读全文
posted @ 2017-07-24 02:28 Zhentiw 阅读(460) 评论(0) 推荐(0)
摘要: @HostListener('keydown', ['$event', '$event.keyCode']) onKeyDown($event: KeyboardEvent, keyCode) { if(keyCode !== TAB) { $event.preventDefault(); } // get value for the key ... 阅读全文
posted @ 2017-07-24 01:56 Zhentiw 阅读(287) 评论(0) 推荐(0)