Skip to content

Feature Request/Suggestion: Provide a builtin-preprocessing tag to trim textcontent #651

Closed
@UncleBill

Description

@UncleBill

current

<template>
    <div class='box'>
        {{content}}
    </div>
</template>

output:

return n("div", {
            staticClass: "box"
        }, [t._v("\n  " + t._s(t.content) + "\n")])

what I want

return n("div", {
            staticClass: "box"
        }, [t._v(t._s(t.content))])

Suggestion

Wrap text content with a tag like <Text></Text>. The tag will be removed at webpack's compile-time.

<template>
    <div class='box'>
        <Text>{{content}}</Text>
    </div>
</template>

loader's configuration:

{
   query: {
      // default option
      textContentTrimmingTag: 'Text'
   }
}

vuejs/vue#3934

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions