You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
895 B
34 lines
895 B
1 year ago
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css"/>
|
||
|
<script src="https://unpkg.com/vue@3.2.24/dist/vue.global.js"></script>
|
||
|
<title>v-model</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="app">
|
||
|
<input type="text" v-model="tips">
|
||
|
<h2>{{ tips }}</h2>
|
||
|
<input type="button" value="修改" @click="change_tips">
|
||
|
</div>
|
||
|
<script type="text/javascript">
|
||
|
const App = {
|
||
|
data() {
|
||
|
return {
|
||
|
tips: "初始的文本信息",
|
||
|
btn_tips: "点击按键后的信息"
|
||
|
}
|
||
|
},
|
||
|
methods: {
|
||
|
change_tips: function () {
|
||
|
this.tips = this.btn_tips
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
Vue.createApp(App).mount("#app")
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|