分享

成功element ui弹出新页面

 北方天空A 2020-08-18

子页面

<template>

  <div class="app-container">

    <el-button type="primary" icon="el-icon-plus" size="small" @click="handleclick()">添加</el-button>

    <el-dialog

      title

      :visible.sync="openOff"

      center

      :append-to-body="true"

      :lock-scroll="false"

      width="30%"

      fullscreen="true"

    >

      <prop_form></prop_form>

    </el-dialog>

  </div>

</template>

<script>

import prop_form from "@/views/form/prop_form.vue";

export default {

  components: {

    prop_form,

  },

  data() {

    return {

      form: {},

      openOff: false,

    };

  },

  methods: {

    handleclick() {

      this.openOff = true//默认页面不显示为false,点击按钮将这个属性变成true

    },

  },

};

</script>

<style scoped>

.line {

  text-aligncenter;

}

</style>

父页面

<template>

  <el-container>

    <el-header>Header</el-header>

    <el-container>

      <el-aside width="200px">Aside</el-aside>

      <el-main>Main</el-main>

    </el-container>

  </el-container>

</template>

<style>

.el-header,

.el-footer {

  background-color#b3c0d1;

  color#333;

  text-aligncenter;

  line-height60px;

}

.el-aside {

  background-color#d3dce6;

  color#333;

  text-aligncenter;

  line-height200px;

}

.el-main {

  background-color#e9eef3;

  color#333;

  text-aligncenter;

  line-height160px;

}

body > .el-container {

  margin-bottom40px;

}

.el-container:nth-child(5.el-aside,

.el-container:nth-child(6.el-aside {

  line-height260px;

}

.el-container:nth-child(7.el-aside {

  line-height320px;

}

</style>

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多