Using Vue js component without webpack

Using Vue js component without webpack



Trying to migrate from jQuery web page to VueJs.



I thought wholly rebuild web page to vue-cli based template code might be difficult.



So 1st Step to migrate jQuery to vuejs without webpack. It means all page keep individual pages not SPA. So every single page include vue.js with <script> tag.


<script>



I stuck with jQuery slider.



Original code seems like $( ".slider" ).slider({....


$( ".slider" ).slider({...



Converting jQuery's slider to vue-slider-component was stuck, cause I don't know how can make static js from vue components.



My expectation is at below.


<head>
<script src="https://unpkg.com/vue"></script>
<script src="vue-slide.js"></script> <-- like this
</head>
<body>
<vue-slider v-ref:slider :value.sync="value"></vue-slider>
...
<script>
new Vue({ ...
</script>
</body>



Is stupid idea?



What is the best practice for converting jQuery to vuejs without heavy cost?





There isn't a 1-to-1 conversion between jQuery and Vue, they work very differently and do entirely different things. You have to decide if you want to have your entire webpage controlled by one main Vue instance, or do you want only certain sections of the webpage to be Vue components; I'm guessing you want the latter, which is not the typical Vue setup.
– Decade Moon
Sep 4 '18 at 5:29





Yes, right. I want the later that only certain sections of the webpage to be Vue components. My naive idea was migrating single page one by one whenever modification required.
– sungyong
Sep 4 '18 at 5:40





This article summarizes well your possibilities, I advise you to use option 3 (x-templates): vuejsdevelopers.com/2017/03/24/vue-js-component-templates . Your code above doesn't work because you need to initialize the Vue instance and templates before using them.
– Máté Wiszt
Sep 4 '18 at 8:23





0



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Some of your past answers have not been well-received, and you're in danger of being blocked from answering.



Please pay close attention to the following guidance:



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)