matchMedia.ts 284 字节
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2 3 4 5 6 7 8 9 10
import { ElementNode, NodeTransform } from '@vue/compiler-core'

export const matchMedia: NodeTransform = (node) => {
  if (
    process.env.UNI_PLATFORM !== 'mp-weixin' &&
    (node as ElementNode).tag === 'match-media'
  ) {
    ;(node as ElementNode).tag = 'uni-match-media'
  }
}