提交 2a62f740 编写于 作者: C csdn_xiaomei

Auto Commit

上级 7a093d7e
run = "npm i && npm run dev"
language = "node"
[deployment]
build = "npm i && npm run build"
......@@ -8,3 +9,6 @@ run = "npm run preview"
PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}"
XDG_CONFIG_HOME = "/root/.config"
npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global"
[debugger]
program = "main.js"
<script setup>
import HelloWorld from './components/HelloWorld.vue'
import TheWelcome from './components/TheWelcome.vue'
</script>
<template>
<header>
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />
<div class="wrapper">
<HelloWorld msg="You did it!" />
<div>
<h2>{{ time }}</h2>
<button @click="handleClick">{{ str }}</button>
</div>
</header>
<main>
<TheWelcome />
</main>
</template>
<style scoped>
header {
line-height: 1.5;
}
.logo {
display: block;
margin: 0 auto 2rem;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
}
header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
<script setup>
import { ref } from "vue";
let str = ref("倒计时");
let isClick = ref(false);
let time = ref(10);
const handleClick = () => {
if (isClick.value) return false;
isClick.value = true;
let timer = setInterval(() => {
time.value--;
str.value = `剩余${time.value}秒`;
if (time.value < 1) {
clearInterval(timer);
isClick.value = false;
time.value = 10;
str.value = `再次发送`;
}
}
</style>
}, 1000);
};
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册