提交 30fdb7c3 编写于 作者: Q qq_63480508

Auto Commit

上级 aa50c4cb
<script setup> <script setup>
import HelloWorld from './components/HelloWorld.vue' import HelloWorld from './components/HelloWorld.vue'
import TheWelcome from './components/TheWelcome.vue' // import TheWelcome from './components/TheWelcome.vue'
</script> </script>
<template> <template>
<header> <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"> <div class="wrapper">
<HelloWorld msg="You did it!" /> <HelloWorld msg="You did it!" />
......
<script setup> <template>
defineProps({ <div class="box2">
msg: { <ul>
type: String, <li v-for="(item,index) in items":key="index" @click="selectItem(index)" :class="{selected:selectedIndex===index}">
required: true {{item.id}}
} {{item.text}}
}) {{item.path}}
</script> {{item.password}}
</li>
<template> </ul>
<div class="greetings"> </div>
<h1 class="green">{{ msg }}</h1> </template>
<h3>
You’ve successfully created a project with <script>
<a target="_blank" href="https://vitejs.dev/">Vite</a> + export default{
<a target="_blank" href="https://vuejs.org/">Vue 3</a>. name:" Hollowrld",
</h3> data(){
</div> return{
</template> items:[
{id:"1",text:'item2',path:"/route" ,password:"123456"},
<style scoped> {id:"2",text:'item2',path:"/route",password:"456789"},
h1 { { id:"3",text:'item2',path:"/route", password:"457812"}
font-weight: 500; ],
font-size: 2.6rem; selectedIndex:null
top: -10px; };
} },
methods:{
h3 { selectItem(index){
font-size: 1.2rem; this.selectedIndex=index;
} console.log(`selected item: ${this.items[index]}` );
}
.greetings h1, }
.greetings h3 { }
text-align: center; </script>
}
<style scoped>
@media (min-width: 1024px) { .box2 {
.greetings h1, border: 1px solid #ccc;
.greetings h3 { padding: 10px;
text-align: left; }
}
} .box2 ul {
</style> 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.
先完成此消息的编辑!
想要评论请 注册