-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buefy-next for CodePen #221
Comments
@kikuomax Is it possible that the package name and the name of the .js file are to blame? |
@wesdevpro It might be, but I am sceptic about the possibility. |
I feeling more skeptic my self about that assumption. How much work are we talking here to create the global version of buefy? |
@wesdevpro I think Rollup should have an option to output a suitable bundle. We can learn from how Vue builds its global bundle. |
For the record this is the code pen @kikuomax is talking about: https://codepen.io/service-paradis/pen/KKgJZOK |
@kikuomax have you tried using jsdelivr? buefy#4033 |
@wesdevpro The root cause might be this line.
Calling |
Related issue |
@kikuomax is their any update here? |
@kikuomax please let me know if there is any specific direction you would like me to take in investigating this issue. Thanks 😎 |
Fixes the issue that `use(Buefy)` in the root index file was meaningless or rather harmful to Vue 3 apps. It caused a "not a function" error in some environment: see ntohq#221 (comment) Simply removes `use(Buefy)` in the root index file.
Fixes the issue that `use(Buefy)` in the root index file was meaningless or rather harmful to Vue 3 apps. It caused a "not a function" error in some environment: see #221 (comment) Simply removes `use(Buefy)` in the root index file.
@wesdevpro Although we cannot test if <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CodePen Simulation</title>
<link rel="stylesheet" href="dist/buefy.css">
<script>
// we need this tweak because Buefy is not built for browsers
window.process = { env: { NODE_ENV: 'production' } };
</script>
<script src="https://cdn.jsdelivr.net/npm/vue@3.4.31/dist/vue.global.min.js"></script>
<script src="dist/buefy.min.js"></script>
</head>
<body>
<div id="app" class="container"></div>
<script>
const { createApp, ref } = Vue;
const App = {
template: `
<section class="container">
<b-button @click="clickMe">Click Me</b-button>
</section>
`,
methods: {
clickMe() {
this.$buefy.notification.open('Clicked!!');
}
}
};
const app = createApp(App);
app.use(Buefy.default);
app.mount('#app');
</script>
</body>
</html> |
Makes sense @kikuomax 👍🏼 and sounds like a plan |
@kikuomax I don't Buefy-next@v0.1.4 fixed the code pen issue |
@wesdevpro I think I made it work. |
The code pen also worked for me. Now we just need to update all of our code pens? |
@wesdevpro I believe so. |
Description
I had trouble to install
buefy-next
into a Vue 3 app on CodePen. I had to let the appuse
thebuefy-next
plugin but was not able to obtain the plugin object.https://unpkg.com/@ntohq/buefy-next/dist/buefy.js
to the external scripts did not work; it populatedBuefy
in the global scope, though, it was an empty object ({}
).https://esm.sh/@ntohq/buefy-next
.I think we would need to distribute a "global" variant of
buefy-next
, which puts thebuefy-next
plugin into the top-levelvar Buefy
. Vue 3 provides such a variant: https://unpkg.com/vue@3.4.21/dist/vue.global.jsWhy Buefy need this feature
If
buefy-next
is supported on CodePen, we can update the CodePen in the issue template, which currently does not usebuefy-next
but Buefy for Vue 2.This will also allow us to include
buefy-next
via a<script>
tag.The text was updated successfully, but these errors were encountered: