From 32a3177738b4eb22a39f8d22a497330cdda9aebe Mon Sep 17 00:00:00 2001 From: Alex <115539090+Alex-Programer@users.noreply.github.com> Date: Fri, 18 Nov 2022 13:29:59 +0800 Subject: [PATCH] doc: update vue.md (#126) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 和[Attribute 绑定]的部分重叠了 * doc: 新增自定义指令 * doc: 新增[响应式样式] * docs: [入门]部分改为vue3写法 * docs: 新增获取事件对象相关内容 * fix: 删除多余文件 * docs: 新增[组件通信]相关内容 --- docs/vue.md | 236 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 136 insertions(+), 100 deletions(-) diff --git a/docs/vue.md b/docs/vue.md index 5f9c996..c113341 100644 --- a/docs/vue.md +++ b/docs/vue.md @@ -64,13 +64,11 @@ $ npm run build ```js -import { createApp, ref } from 'vue' +import { createApp } from 'vue' const app = createApp({ - setup() { - const count = ref(0) - - return { count } + data() { + return { count: 0 } } }) app.mount('#app') @@ -92,18 +90,15 @@ app.mount('#app')
Now you see me
-``` - -### 自定义指令 Directives - - -```html - - - - - -``` - - -更多[指令函数参考](https://vuejs.org/guide/reusability/custom-directives.html) - 响应式基础 --- @@ -477,28 +422,6 @@ export default defineComponent({ }); ``` -### 响应式样式 - -```js - - - - -to capital: {{ capital }}
``` + +组件通信 +--- + +### defineProps + +```js + + + +username: {{ username }}
+ +``` + +子组件定义需要的参数 + +```js + + + +