Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
眼红的小孩
VueJS
提交
30fdb7c3
V
VueJS
项目概览
眼红的小孩
/
VueJS
与 Fork 源项目一致
Fork自
inscode / VueJS
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
VueJS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
30fdb7c3
编写于
3月 11, 2025
作者:
Q
qq_63480508
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Auto Commit
上级
aa50c4cb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
60 addition
and
45 deletion
+60
-45
src/App.vue
src/App.vue
+2
-2
src/components/HelloWorld.vue
src/components/HelloWorld.vue
+58
-43
未找到文件。
src/App.vue
浏览文件 @
30fdb7c3
<
script
setup
>
import
HelloWorld
from
'
./components/HelloWorld.vue
'
import
TheWelcome
from
'
./components/TheWelcome.vue
'
//
import TheWelcome from './components/TheWelcome.vue'
</
script
>
<
template
>
<header>
<
img
alt=
"Vue logo"
class=
"logo"
src=
"./assets/logo.svg"
width=
"125"
height=
"125"
/
>
<
!--
<img
alt=
"Vue logo"
class=
"logo"
src=
"./assets/logo.svg"
width=
"125"
height=
"125"
/>
--
>
<div
class=
"wrapper"
>
<HelloWorld
msg=
"You did it!"
/>
...
...
src/components/HelloWorld.vue
浏览文件 @
30fdb7c3
<
script
setup
>
defineProps
({
msg
:
{
type
:
String
,
required
:
true
}
})
</
script
>
<
template
>
<div
class=
"greetings"
>
<h1
class=
"green"
>
{{
msg
}}
</h1>
<h3>
You’ve successfully created a project with
<a
target=
"_blank"
href=
"https://vitejs.dev/"
>
Vite
</a>
+
<a
target=
"_blank"
href=
"https://vuejs.org/"
>
Vue 3
</a>
.
</h3>
</div>
</
template
>
<
style
scoped
>
h1
{
font-weight
:
500
;
font-size
:
2.6rem
;
top
:
-10px
;
}
h3
{
font-size
:
1.2rem
;
}
.greetings
h1
,
.greetings
h3
{
text-align
:
center
;
}
@media
(
min-width
:
1024px
)
{
.greetings
h1
,
.greetings
h3
{
text-align
:
left
;
}
}
</
style
>
<
template
>
<div
class=
"box2"
>
<ul>
<li
v-for=
"(item,index) in items"
:key=
"index"
@
click=
"selectItem(index)"
:class=
"
{selected:selectedIndex===index}">
{{
item
.
id
}}
{{
item
.
text
}}
{{
item
.
path
}}
{{
item
.
password
}}
</li>
</ul>
</div>
</
template
>
<
script
>
export
default
{
name
:
"
Hollowrld
"
,
data
(){
return
{
items
:[
{
id
:
"
1
"
,
text
:
'
item2
'
,
path
:
"
/route
"
,
password
:
"
123456
"
},
{
id
:
"
2
"
,
text
:
'
item2
'
,
path
:
"
/route
"
,
password
:
"
456789
"
},
{
id
:
"
3
"
,
text
:
'
item2
'
,
path
:
"
/route
"
,
password
:
"
457812
"
}
],
selectedIndex
:
null
};
},
methods
:{
selectItem
(
index
){
this
.
selectedIndex
=
index
;
console
.
log
(
`selected item:
${
this
.
items
[
index
]}
`
);
}
}
}
</
script
>
<
style
scoped
>
.box2
{
border
:
1px
solid
#ccc
;
padding
:
10px
;
}
.box2
ul
{
list-style-type
:
none
;
padding
:
0
;
}
.box2
li
{
cursor
:
pointer
;
padding
:
5px
;
margin-bottom
:
5px
;
background-color
:
#f9f9f9
;
}
.box2
li
.selected
{
background-color
:
#ddd
;
font-weight
:
bold
;
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录