asyncData 返回值自动 merge 进 data,并且只能使用在 pages。
fetch 接受一个 callback,不会自动 merge 到 data,但是可以使用在任何 .vue 组件中。
const defaultProps = { | |
editable: { | |
name: true, | |
age: true, | |
} | |
} | |
<Card /> // ok | |
<Card editable={{ name: false }} /> // NG, because you lose `editable.age` |
vi + ', {, [ |
从资源加载角度,responsive 是资源不友好的。 |
this.$emit('my-event') | |
// 👇 无效,详细:https://cn.vuejs.org/v2/guide/components-custom-events.html#事件名 | |
this.$emit('myEvent') |
export default { | |
build: { | |
extend(config, ctx) { | |
// add externals | |
config.externals = { | |
moment: 'moment', | |
} | |
}, | |
}, | |
} |
<todo-list v-bind:todos="todos"> | |
<template v-slot:todo="{ todo }"> | |
<span v-if="todo.isComplete">✓</span> | |
{{ todo.text }} | |
</template> | |
</todo-list> |
不要直接运行 docker container,使用 docker-compose 运行 docker container。 |
WARNING: baseURL and proxy cannot be used at the same time, | |
so when the proxy option is in use, | |
you need to define prefix instead of baseURL. |
https://nuxtjs.org/faq/http-proxy | |
- 如果已经 install [nuxt-axios],则不需要再次 install |
asyncData 返回值自动 merge 进 data,并且只能使用在 pages。
fetch 接受一个 callback,不会自动 merge 到 data,但是可以使用在任何 .vue 组件中。