how to watch dom
<template lang="html">
<div class="a">
<div class="goods-container">
<div class="goods-left" ref="leftScroll">
<ul>
<li class="goods-left-list" :class="{"active":currentIndex===idex}" v-for="(item,idex) in goods" :key="item.name" @click="tofood(idex)">
<span class="text border-1px">
<span class="icon" v-if="item.type>0" :class="icon[item.type]"></span>{{item.name}}
</span>
</li>
</ul>
</div>
data() {
return {
goods: [],
icon: ["decrease", "discount", "guarantee", "invoice", "special"],
listHeight: [],
scorllY: 0,
foodInfo: {},
dom: this.$refs.leftScroll
};
},
``
watch: {
dom(newvalue,oldvalue) {
console.log("aaa");
console.log(newvalue+"-------"+oldvalue);
}
},
dom for watch
data dom undefinde