智慧保安互联网APP
zengh
2022-06-21 4efeb31d5b4921d7e851c256009486ad86bc70e2
xcxMapSecurityPosition/popup/user.html
New file
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>popup</title>
    <!-- Vue -->
   <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
</head>
<body>
    <div id="popup">
        <!-- 从layui传值给iframe 的占位input -->
        <input type="text" id="user" ref="user" style="display:none">
        46476978--
        -{{ourData.title}}
    </div>
    <script>
        var me = new Vue({
            el: '#popup',
            data: {
                ourData: '',
                oldtime: '',
            },
            mounted() {
                this.oldtime = setTimeout(() => {//需要同步数据处理,input中value在mounted中没有直接传值
                    clearTimeout(this.oldtime);
                    this.ourData = JSON.parse(this.$refs.user.value);//json对象转js对象
                    console.log(this.ourData,2)
                }, 100);
            }
        })
    </script>
</body>
</html>