Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
uuai
test_git
提交
807421b4
T
test_git
项目概览
uuai
/
test_git
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
test_git
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
807421b4
编写于
4月 24, 2022
作者:
W
wuyb@phxg.cn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vue3 - jsx
上级
c297e89c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
136 addition
and
2 deletion
+136
-2
vite-demo/README.md
vite-demo/README.md
+3
-1
vite-demo/src/router/backRouter.js
vite-demo/src/router/backRouter.js
+31
-1
vite-demo/src/views/skills/components/btn1.vue
vite-demo/src/views/skills/components/btn1.vue
+18
-0
vite-demo/src/views/skills/components/btn2.vue
vite-demo/src/views/skills/components/btn2.vue
+16
-0
vite-demo/src/views/skills/components/message.vue
vite-demo/src/views/skills/components/message.vue
+24
-0
vite-demo/src/views/skills/components/renderFn.js
vite-demo/src/views/skills/components/renderFn.js
+15
-0
vite-demo/src/views/skills/vue3/fnApi.vue
vite-demo/src/views/skills/vue3/fnApi.vue
+29
-0
未找到文件。
vite-demo/README.md
浏览文件 @
807421b4
...
...
@@ -11,4 +11,6 @@ This template should help get you started developing with Vue 3 in Vite. The tem
```
\ No newline at end of file
```
[
vue3自定义指令
](
https://mp.weixin.qq.com/s/PZSbtcy8FEIITVqA9OYR2Q
)
\ No newline at end of file
vite-demo/src/router/backRouter.js
浏览文件 @
807421b4
...
...
@@ -42,7 +42,7 @@ export default [
},
component
:
'
/views/form/index.vue
'
,
redirect
:
'
/form/antdVue/antdForm
'
,
children
:[
children
:
[
{
path
:
'
antdForm
'
,
name
:
'
antdForm
'
,
...
...
@@ -129,5 +129,35 @@ export default [
component
:
'
/views/tool/mdEditor.vue
'
,
},
]
},
{
path
:
'
/skills
'
,
name
:
'
skills
'
,
meta
:
{
title
:
'
知识点
'
,
},
component
:
'
Layout
'
,
children
:
[
{
path
:
'
vue3
'
,
name
:
'
vue3
'
,
title
:
'
vue3
'
,
meta
:
{
title
:
'
vue3
'
,
},
component
:
'
/views/form/index.vue
'
,
children
:
[
{
path
:
'
fnApi
'
,
name
:
'
fnApi
'
,
meta
:
{
title
:
'
vue3开发技巧
'
,
},
component
:
'
/views/skills/vue3/fnApi.vue
'
,
},
]
},
]
}
]
vite-demo/src/views/skills/components/btn1.vue
0 → 100644
浏览文件 @
807421b4
<
template
>
<div>
这是btn1
<p>
{{
num
}}
</p>
<slot></slot>
<slot
name=
"name"
:text=
"num"
></slot>
</div>
</
template
>
<
script
>
import
{
ref
,
defineComponent
}
from
'
vue
'
export
default
defineComponent
({
name
:
'
btn1
'
,
setup
()
{
const
num
=
ref
(
1
)
return
{
num
}
}
})
</
script
>
\ No newline at end of file
vite-demo/src/views/skills/components/btn2.vue
0 → 100644
浏览文件 @
807421b4
<
template
>
<div>
这是btn2
{{
num
}}
<slot></slot>
</div>
</
template
>
<
script
>
import
{
ref
,
defineComponent
}
from
'
vue
'
export
default
defineComponent
({
name
:
'
btn2
'
,
setup
()
{
const
num
=
ref
(
2
)
return
{
num
}
}
})
</
script
>
\ No newline at end of file
vite-demo/src/views/skills/components/message.vue
0 → 100644
浏览文件 @
807421b4
<
template
>
<div>
<div>
{{
num
}}
</div>
<div>
这是一个弹窗
</div>
</div>
</
template
>
<
script
>
import
{
ref
}
from
'
vue
'
export
default
{
name
:
"
message
"
,
setup
()
{
const
num
=
ref
(
1
)
return
{
num
}
},
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
vite-demo/src/views/skills/components/renderFn.js
0 → 100644
浏览文件 @
807421b4
import
btn1
from
'
./btn1.vue
'
import
btn2
from
'
./btn2.vue
'
import
{
h
}
from
'
vue
'
export
const
renderFn
=
function
(
props
,
{
slots
})
{
console
.
log
(
'
renderFn
'
,
props
);
console
.
log
(
'
renderFn
'
,
slots
);
// 加载组件
// return props.type == 1 ? h(btn1) : h(btn2)
// 加载默认插槽 - 具名插槽
return
props
.
type
==
1
?
h
(
btn1
,
[
slots
.
default
(),
slots
.
name
({
text
:
props
.
type
})])
:
h
(
btn2
)
}
vite-demo/src/views/skills/vue3/fnApi.vue
0 → 100644
浏览文件 @
807421b4
<
template
>
<div
id=
"mask"
></div>
<renderFn
:type=
"1"
>
<p>
默认插槽: 111111
</p>
<template
#name
>
<span>
具名插槽
</span>
name
</
template
>
</renderFn>
</template>
<
script
>
import
{
renderFn
}
from
'
../components/renderFn.js
'
console
.
log
(
renderFn
);
export
default
{
name
:
"
createVNode
"
,
components
:
{
renderFn
},
setup
(
props
,
ctx
)
{
console
.
log
(
ctx
);
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录