<template>
<div class="hello">
<div>
<p> value:{{ state }}</p>
</div>
</div>
</template>
<script lang="ts">
import { watch } from 'vue'
import { useMediaQuery } from "v3hooks";
export default {
props: {
msg: String,
},
setup() {
const state = useMediaQuery('(min-width: 480px)');
watch(
state,
(value)=>{
if(!value) console.log('已经是480px以下了')
}
)
// useVirtualList测试
return {
state
};
},
};
</script>
const useMediaQuery: (query: string) => vue.Ref<boolean>;