1. npm install --save screenfull
    2. import screenfull from "screenfull";
    3. //dom
    4. <el-button type="primary" class="button" @click="click">按钮</el-button>
    5. //点击函数
    6. click() {
    7. // 判断是否支持
    8. if (!screenfull.enabled) {
    9. this.$message({
    10. message: "不支持全屏",
    11. type: "warning"
    12. });
    13. return false;
    14. }
    15. screenfull.toggle();
    16. }