提交 8535d7f1 编写于 作者: Q qq_73547057

Thu Dec 28 11:45: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"
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="UTF-8" /> <head>
<link rel="icon" href="/favicon.ico" /> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title> <title>methods方法</title>
</head> </head>
<body>
<div id="app"></div> <body>
<script type="module" src="/src/main.js"></script> <div id="app">
</body> <!-- methods的直接调用 -->
</html> <p>{{hello()}}</p>
<p>{{add()}}</p>
<button v-on:click="btnClick">点击</button>
<p>{{msg}}</p>
<ul>
<li>姓名:{{name}}</li>
<li>城市:{{city}}</li>
</ul>
</div>
<script>
let vm = new Vue({
el: '#app',
data: {
name: "llt",
city: "Beijing",
price1: 50,
price2: 200,
msg: "旧文本"
},
methods: {
hello() {
return this.name + "你好!欢迎来到" + this.city + "祝你玩得愉快";
},
add: function () {
return this.price1 + this.price2;
},
btnClick() {
this.msg = "新文本"
},
}
})
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册