UNPKG

@cran/vue.use

Version:

Cranberry Vue Use Utilities

16 lines (15 loc) 449 B
import { bid } from "../utility/bem"; import { getCurrentInstance } from "@vue/runtime-dom"; export function useBid(block) { const name = block || getCurrentInstance().proxy.$options.name; return new Proxy(function getBid() { return bid(name); }, { get(_target, property) { if ("string" !== typeof property) { return; } return bid(name, property); }, }); }