-
Notifications
You must be signed in to change notification settings - Fork 0
/
Read More Read Less button.html
48 lines (40 loc) · 1.22 KB
/
Read More Read Less button.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./font-awesome-4.7.0/css/font-awesome.min.css ">
<!-- development version, includes helpful console warnings -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body class="container">
<div id="app">
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum iste
<span class="dots" v-show="!more">...</span>
<span class="more" v-show="more">iusto magni voluptas impedit vitae neque aut eaque repudiandae laboriosam in,
minima totam animi sunt aliquam? Architecto at esse labore?</span></br>
</p>
<a href="#" @click="toggleText" class="btn-primary btn my-3">{{buttonText}}</a>
</div>
</body>
<script>
var app = new Vue({
el:'#app',
data:{
more:false,
},
methods:{
toggleText: function(){
this.more = !this.more
}
},
computed: {
buttonText: function () {
return this.more ? 'Show Less' : 'Show More';
}
}
});
</script>
</html