Closed u01jmg3 closed 3 years ago
Yes, just use v2.x.
npm install vue@next @chenfengyuan/vue-countdown@next
I've just tried using 2.0.0-rc
but I'm struggling to get things working. Here's my code (commented out is the code as it was working under Vue 2):
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div id="app">
<template>
<!--<countdown :time="2 * 24 * 60 * 60 * 1000" v-slot="{ days, hours, minutes }">-->
<vue-countdown :time="2 * 24 * 60 * 60 * 1000" v-slot="{ days, hours, minutes }">
{{ days }} days, {{ hours }} hours, {{ minutes }} minutes
</vue-countdown>
<!--</countdown>-->
</template>
</div>
<!--<script src="https://unpkg.com/vue@2.6.12/dist/vue.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@chenfengyuan/vue-countdown@1.1.5/dist/vue-countdown.js" crossorigin="anonymous"></script>
<script>
Vue.component(VueCountdown.name, VueCountdown);
new Vue({el: '#app'});
</script>-->
<script src="https://unpkg.com/vue@3.1.4/dist/vue.global.prod.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@chenfengyuan/vue-countdown@2.0.0-rc/dist/vue-countdown.js" crossorigin="anonymous"></script>
<script>
const { createApp } = Vue;
const app = createApp({});
app.component(VueCountdown.name, VueCountdown);
app.mount('#app');
</script>
</body>
</html>
You don't need to use the <template></template>
element on the root Vue instance! Just drop it!
Will this library be updated to work with Vue 3?