Vue练习十:02_04_弹出层

Demo 在线地址:

https://sx00xs.github.io/test/10/index.html
---------------------------------------------------------------
ide: vscode
文件格式:.vue
解析:(待补)

<template>
  <div id="app">
    <div class="overlay" v-show="show"></div>
    <div class="win" v-show="show">
      <h2><span class="close" @click="handleClose">×</span></h2>
    </div>
    <button @click="handleShow">弹出层</button>
  </div>
</template>
<script>
export default {
  data:function(){
    return{
      show:false
    }
  },
  methods:{
    handleShow(){
      this.show=true;
    },
    handleClose(){
      this.show=false;
    }
  }
}
</script>
原文地址:https://www.cnblogs.com/sx00xs/p/11265968.html