How to use the @tarojs/shared.Shortcuts.Text function in @tarojs/shared

To help you get started, we’ve selected a few @tarojs/shared examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NervJS / taro / packages / taro-runtime / src / render.ts View on Github external
export function hydrate (node: TaroElement | TaroText): MiniData {
  if (isText(node)) {
    return {
      [Shortcuts.Text]: node.nodeValue,
      [Shortcuts.NodeName]: node.nodeName
    }
  }

  const data: MiniData = {
    ...node.props,
    [Shortcuts.Childnodes]: node.childNodes.map(hydrate),
    [Shortcuts.NodeName]: node.nodeName,
    uid: node.uid
  }

  if (node.className) {
    data[Shortcuts.Class] = node.className
  }

  if (node.cssText) {
github NervJS / taro / packages / taro-mini-runner / src / template / index.ts View on Github external
function buildPlainTextTemplate (level: number): string {
  return `
<template name="tmpl_${level}_#text">
  {{i.${Shortcuts.Text}}}
</template>
`
}
github NervJS / taro / packages / taro-runtime / src / dom / text.ts View on Github external
public set textContent (text: string) {
    this._value = text
    this.enqueueUpdate({
      path: `${this._path}.${Shortcuts.Text}`,
      value: text
    })
  }