Wikiki / bulma-steps

Bulma's extension to manage steps
MIT License
96 stars 44 forks source link

attach is not a function error #19

Closed tqiqbal closed 1 year ago

tqiqbal commented 6 years ago

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

Wikiki commented 6 years ago

Hi,

do you still having the issue with the last release ?

tqiqbal commented 6 years ago

Hi,

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

Rg, Tanveer

Wikiki commented 6 years ago

please try bulma-extensions v2.2.1

tqiqbal commented 6 years ago

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.

RiFi2k commented 6 years ago

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