随笔分类 - Vue
摘要:Vue's slots enable you to define where content of a component should land when you define the content inside of a parent component. You can also name
阅读全文
摘要:While traditional Vue components require a data function which returns an object and a method object with your handlers, vue-class-componentflattens c
阅读全文
摘要:While traditional Vue components require a data function which returns an object and a method object with your handlers, vue-class-componentflattens c
阅读全文
摘要:A Promise invokes a function which stores a value that will be passed to a callback. So when you wrap a Promise with an Observable, you'll always get
阅读全文
摘要:You most likely already have data or properties in your template which are controlled by third-party components or updated using data binding. You can
阅读全文
摘要:domStreams enable you to pass additional data along the stream that can be provided by the template (such as data coming from a v-forrendering of an A
阅读全文
摘要:Streams give you the power to handle a "pending" state where you've made a request for data, but the data hasn't yet returned. You can leverage this p
阅读全文
摘要:Splitting a stream into multiple streams causes new subscriptions. You can think of new subscriptions as "invoking a function". So if your original st
阅读全文
摘要:Wrapping the creation of an Observable inside of a Function allows you delay the creation of the Observable until it is needed. This becomes really im
阅读全文
摘要:When an image fails to load, it triggers an error event. You can capture the error event and merge it with your image loading stream to provide a back
阅读全文
摘要:You can map remote data directly into your Vue.js templates using RxJS. This lesson uses axios (and the vue-axios library which exposes axios on compo
阅读全文
摘要:The domStreams component property enables you to access Events from your Vue.js templates as Streams insides your subscriptions function. You can then
阅读全文
摘要:By default, vue-router doesn’t lazy load the routes unless you tell it to do it. Lazy loading of the non-critical routes is one of the points of the P
阅读全文
摘要:In this lesson I show how to use webpack to code split based on route in VueJS. Code splitting is a useful tool to help eliminate unused code and only
阅读全文
摘要:We’ve used @Watch, @Inject and more decorators from vue-property-decorator. In this lesson however we will guide you through creating your own decorat
阅读全文
摘要:Vue 2.2 introduced a simple dependency injection system, allowing you to use provide and inject in your component options. This lesson shows you how t
阅读全文
摘要:With properties we can follow a one-way parent→child flow communication between components. This lesson shows you how you can pass down properties to
阅读全文
摘要:Directives allow us to apply DOM manipulations as side effects. We’ll show you how you can create your own Vue directive to change a component’s color
阅读全文
摘要:vue-router introduces new hooks into the component. In this lesson we’ll show you how to use these new hooks in your class based Vue components in Typ
阅读全文
摘要:Starter app: https://github.com/alexjoverm/Vue-Typescript-Starter Writing Vue components as plain objects has very limited capabilities for TypeScript
阅读全文