提交 0621662f 编写于 作者: Q qq_73547057

Mon Dec 18 17:41:00 CST 2023 inscode

上级 7a093d7e
run = "npm i && npm run dev" run = "npm i && npm run dev"
language = "node"
[deployment] [deployment]
build = "npm i && npm run build" build = "npm i && npm run build"
...@@ -8,3 +9,6 @@ run = "npm run preview" ...@@ -8,3 +9,6 @@ run = "npm run preview"
PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}" PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}"
XDG_CONFIG_HOME = "/root/.config" XDG_CONFIG_HOME = "/root/.config"
npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global" npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global"
[debugger]
program = "main.js"
...@@ -4,6 +4,7 @@ import TheWelcome from './components/TheWelcome.vue' ...@@ -4,6 +4,7 @@ import TheWelcome from './components/TheWelcome.vue'
</script> </script>
<template> <template>
<div id="app"> <vote v-for="(item, index) in list" :key="index" :avatar="item.avatar" :name="item.name"></vote> </div>
<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" />
...@@ -16,6 +17,11 @@ import TheWelcome from './components/TheWelcome.vue' ...@@ -16,6 +17,11 @@ import TheWelcome from './components/TheWelcome.vue'
<TheWelcome /> <TheWelcome />
</main> </main>
</template> </template>
<script>
import Vote from './components/vote.vue'
export default { name: 'App', components: { Vote }, data() { return { list: [ {avatar: require('./assets/jane.png'), name: 'Jane'}, {avatar: require('./assets/kate.png'), name: 'Kate'}, {avatar: require('./assets/mike.png'), name: 'Mike'}, {avatar: require('./assets/tom.png'), name: 'Tom'} ] } } }
</script>
<style scoped> <style scoped>
header { header {
......
<template>
<div class="vote"> <img :src="avatar" :alt="name">
<p>{{ name }}</p> <button @click="voteCount++">投票</button>
<p>票数:{{ voteCount }}</p>
</div>
</template>
<script>
export default {
props: { avatar: String, name: String }, data() {
return { voteCount: 0 }
}
}
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册