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.
30 lines
851 B
30 lines
851 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">
|
||
|
<meta http-equiv="X-UA-Compatible" content="ie=edfe">
|
||
|
<script src="https://unpkg.com/vue@3.3.4/dist/vue.global.js"></script>
|
||
|
<title>v-bind</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="app">
|
||
|
<img v-bind:src="imgSrc" v-bind:title="imgTitle">
|
||
|
<img :src="imgSrc" :class="isActive?'active':''">
|
||
|
<img :src="imgSrc" :class="{active:!isActive}">
|
||
|
</div>
|
||
|
<script type="text/javascript">
|
||
|
const App = {
|
||
|
data() {
|
||
|
return {
|
||
|
imgSrc: "https://www.baidu.com/img/PCfb_5bf082d29588c07f842ccde3f97243ea.png",
|
||
|
imgTitle: "百度一下下",
|
||
|
isActive: true,
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
Vue.createApp(App).mount("#app")
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|