vue3 判断包含某个字符

vue3 判断包含某个字符_第1张图片

<img v-if="node.level === 1 && checkIfIncludeSubStr(node.label, '人口')"
                    src="@/assets/images/icon-convention-01.png" width="16"
                    class="inlineBlock Vmiddle" style="margin-right: 8px;"/>
                    
const data = reactive({
  includeSubStr: ''
})
const checkIfIncludeSubStr = (label, str) => {
  data.includeSubStr = label
  return data.includeSubStr.includes(str);
}

你可能感兴趣的:(vue.js,javascript,前端)