$refs的基本用法

一个对象(Object),持有注册过 ref 特性 的所有 DOM 元素和组件实例。

 

 

<template>
    <view class="container" style="background: #0FAEFF;">
        <view class="child"> hi {{showModal}}</view>
    </view>
</template>
<script>
    export default {
        props: {
            showModal: {
                type: String,
                default: 'hello'
            }
        },
        data() {
            return {
                childdata: 'child value'
            };
        },
        methods: {
            sayHello() {
                console.info("--child:--" + this.showModal);
            }
        }
    }
</script>
 
child

相关文章:

  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2023-03-28
  • 2021-07-06
猜你喜欢
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案