Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!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=edge">
- <title>Lorem Ipsum doller site ammet</title>
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.2.3/css/bulma.css">
- </head>
- <body>
- <div id="root" class="container">
- <message title="helloworld" body="lorem ipsum ammet"></message>
- <message title="helloworld" body="lorem ipsum ammet"></message>
- <message title="helloworld" body="lorem ipsum ammet"></message>
- </div>
- <script src="https://unpkg.com/vue@2.1.3/dist/vue.js"></script>
- <script src="main.js"></script>
- <!--
- <script>
- var app = new Vue({
- el:'#root',
- data:{
- title: 'sabi orin',
- tasks: [
- {descriptin: 'goto shop', completed: true},
- {descriptin: 'goto UNI', completed: true},
- {descriptin: 'goto nilkhet', completed: true},
- {descriptin: 'goto newmarket', completed: false},
- {descriptin: 'goto shop', completed: false},
- ],
- },
- computed :{
- reversedMessage(){
- return this.title.split('').reverse().join('');
- } ,
- incompletedTask(){
- return this.tasks.filter(task => task.completed == false)
- }
- },
- })
- </script>
- -->
- </body>
- </html>
- Vue.component('message',{
- props:['title', 'body'],
- data(){
- return{
- isVisible:true,
- };
- },
- template: `
- <article class="message" v-show="isVisible">
- <div class="message-header">
- {{title}}
- <button type="button" @click="hideModal">x</button>
- </div>
- <div class="message-body">
- {{body}}
- </div>
- </article>
- `,
- methods:{
- hideModal(){
- this.isVisible = false;
- },
- },
- });
- new Vue({
- el:'#root',
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement