question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vue 2.0.5

Filters in :bind does not work

<span :title="text | doUppercase">{{ text | doUppercase }}</span>
<span :title="doUppercase(text)">{{ text | doUppercase }}</span>

Working example not using in any binds, but just in plain simple element <span>{{ text | doUppercase }}</span>

Adding filters to a bind via <span :title="text | doUppercase">{{ text | doUppercase }}</span>

Result in a vue.min.js:6ReferenceError: doUppercase is not defined(…)

Also tried adding filters via <span :title="doUppercase(text)">{{ text | doUppercase }}</span>

Result in a vue.min.js:6ReferenceError: doUppercase is not defined(…)

So you can not use filters in :bind?

In the documentation is reads: Vue 2.x filters can only be used inside mustache bindings

Is this a mustache bindings? -

My use case is quite simple

My output would be something like this

Input: <span :title="date | momentFull">{{ date | moment }}</span> Output: <span title="2016-11-10 08:32">2 hours ago</span>

filters: {
  moment (date) {
    return Moment(date).fromNow();
  },
  momentFull (date) {
   return Moment(date).format('YYYY-MM-DD HH:mm');
  }
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
posvacommented, Nov 10, 2016

I don’t think so because it belongs to migration. It’s absent on the Vue 2 docs because it doesn’t exist anymore after all

0reactions
posvacommented, Nov 10, 2016

It looks pretty clear to me: https://vuejs.org/v2/guide/syntax.html#Filters The reason is that bindings’ content is jslike. Filters are a common practice in interpolation

Read more comments on GitHub >

github_iconTop Results From Across the Web

Binding Properties of Filters | Life Science Research
Data from research conducted by MilliporeSigma on the protein binding properties of selected filters are summarized in this chart: ...
Read more >
Filter binding assay - Wikipedia
In biochemistry or chemistry, filter binding assay is a simple way to quickly study many samples. One of the ways to learn about...
Read more >
Property binding for `value1` in Filter - sapui5 - Stack Overflow
I want to know if I can do a property binding for value1 ? Now the filter SHOULD be dependent to the Model....
Read more >
Filter Binding Assay - an overview | ScienceDirect Topics
Filter binding assay is another method that allows a rough analysis of protein–nucleic acid binding. It is based on the principle that, upon...
Read more >
Filter DNS Forwarded responses with Bind - Super User
It is possible to get Bind to filter the addresses returned using the deny-answer-addresses feature. To use this add the following to the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found