Is "cs" a reserved word in vue?


#1

I am experiencing some weird behavior in Vue@2.5.17.

I named a function in methods cs.

methods: {
  cs: function() {
     //do stuff
 }
}

However when I try to call it with:
{{cs()}}

I get two errors:
vue.js:597 [Vue warn]: Error in render: "TypeError: cs is not a function"

(found in <Root>)
warn @ vue.js:597
logError @ vue.js:1739
globalHandleError @ vue.js:1734
handleError @ vue.js:1723
Vue._render @ vue.js:4537
updateComponent @ vue.js:2788
get @ vue.js:3140
run @ vue.js:3217
flushSchedulerQueue @ vue.js:2981
(anonymous) @ vue.js:1839
flushCallbacks @ vue.js:1760
Promise.then (async)
microTimerFunc @ vue.js:1808
nextTick @ vue.js:1852
queueWatcher @ vue.js:3068
update @ vue.js:3207
notify @ vue.js:703
reactiveSetter @ vue.js:1020
proxySetter @ vue.js:3298
(anonymous) @ memberships.js:1
Promise.then (async)
retrieveMembershipPack @ memberships.js:1
created @ memberships.js:1
callHook @ vue.js:2921
Vue._init @ vue.js:4617
Vue @ vue.js:4716
(anonymous) @ memberships.js:1
s @ memberships.js:1
(anonymous) @ memberships.js:1
(anonymous) @ memberships.js:1
vue.js:1743 TypeError: cs is not a function
    at eval (eval at createFunction (vue.js:10667), <anonymous>:3:2457)
    at Proxy.renderList (vue.js:3699)
    at Proxy.eval (eval at createFunction (vue.js:10667), <anonymous>:3:1954)
    at Vue._render (vue.js:4535)
    at Vue.updateComponent (vue.js:2788)
    at Watcher.get (vue.js:3140)
at Watcher.run (vue.js:3217)
at flushSchedulerQueue (vue.js:2981)
at Array.<anonymous> (vue.js:1839)
at flushCallbacks (vue.js:1760)

However, If I change the name of the function to “sy”:

methods: {
  sy: function() {
     //do stuff
 }
}

and call it with:
{{sy()}}

I get no errors and my page loads. Weird!

Anybody know what’s causing this?


#2

do you maybe also have a prop / data property / computed property of the same name in your component?

Please share the whole thing, template and code.