bulma-steps icon indicating copy to clipboard operation
bulma-steps copied to clipboard

attach is not a function error

Open tqiqbal opened this issue 7 years ago • 5 comments

Hi, I am getting error while invoking function bulmaSteps.attach(selector, options). I am using VueJs+webpack . I have done these steps.

Imported bulma.css imported bulma-steps.min.css imported bulms-steps.min.js called bulmaSteps.attach(selector, options) In Chrome console I can see this error.

"Task.vue?8a51:152 Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_0_bulma_extensions_bulma_steps_dist_bulma_steps_min_js___default.a.attach is not a function at eval (Task.vue?8a51:152) at Object../node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/pages/Task.vue (app.js:790) at webpack_require (app.js:679) at fn (app.js:89) at eval (Task.vue?bf53:1) at Object../src/components/pages/Task.vue (app.js:1422) at webpack_require (app.js:679) at fn (app.js:89) at eval (index.js?3672:1) at Object../src/router/index.js (app.js:1518)"

Note: I am new to Bulma ( and its extensions) and VueJS

Regards, Tanveer

tqiqbal avatar Jun 19 '18 14:06 tqiqbal

Hi,

do you still having the issue with the last release ?

wikiki avatar Jun 22 '18 09:06 wikiki

Hi,

I had installed bulma-steps (1.0.3) through npm bulma-extensions(1.0.32).

Rg, Tanveer

tqiqbal avatar Jun 22 '18 09:06 tqiqbal

please try bulma-extensions v2.2.1

wikiki avatar Jul 09 '18 19:07 wikiki

Thanks, Error is gone. Great to see new version released. Good work. However I am still unable to navigate through.

here what I did in my Vue Component code.

"import bulmaSteps from 'bulma-extensions/bulma-steps/dist/js/bulma-steps.min.js'; bulmaSteps.attach(document.getElementById('stepsDemo'), { onShow: (id) => console.log(id) });"

Nothing is happening.

tqiqbal avatar Jul 09 '18 20:07 tqiqbal

If someone else is having problems using with Vue, you want to run the attach method in the mounted hook. If you do it there it works perfectly.

https://vuejs.org/v2/guide/components-edge-cases.html#Programmatic-Event-Listeners

RiFi2k avatar Aug 27 '18 19:08 RiFi2k