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
moon-cli qustion #227
Comments
|
have question about 1: I have components like
and
u say i don't need to include components in child component like and u say include them all in so you say components are registered global and don't require components in child file and require or import them in one in Root file am I get ur means right? sry for ask this question many times ... |
Just require("./components/header.moon")(Moon);
require("./components/footer.moon")(Moon);
require("./components/foo.moon")(Moon);
require("./components/bar.moon")(Moon);
// nothing else is required, you can use header, footer, foo, and bar in any component. |
require works but : 1- two component like const Moon = require("moonjs");
require("./components/header.moon")(Moon);
require("./components/footer.moon")(Moon);
new Moon({
el: "#app"
}); <div id="app">
<div>
<header content="moon"></header>
</div>
<div>
<footer></footer>
</div>
</div> when moon refresh localhost tab console error :
found my 1- problem in #130 lowercase ====> UPPERCASE component name or use name option in cli export 2- how to use |
In HTML, tags are automatically turned into lowercase before the JavaScript is even executed — this makes it impossible for Moon to detect capital letters in component names unless the template is passed in the You create a |
and cuz we use es5 we must export router like this ? //need to include moon js in router or just import MoonRouter?
// Moon.use(MoonRouter) in router.js or scripts.js (root file)?
const Moon = require("moonjs");
const MoonRouter = require("moon-router");
const router = new MoonRouter({
});
module.exports = router; |
if we have many many components we must require them in root file ? that's so bad look this example: require("./components/Header.moon")(Moon);
require("./components/Footer.moon")(Moon);
require("./components/Card.moon")(Moon);
require("./components/Sidebar.moon")(Moon);
require("./components/Articles.moon")(Moon);
require("./components/NavBar.moon")(Moon);
require("./components/Home.moon")(Moon);
require("./components/Contact.moon")(Moon);
,
.
.
.
//infinity Require for components just for example...
new Moon({
el: "#app"
}); require all of them into another file.js and require this on root file ? can we ? any solution for this @kbrsh ? |
another question about moon update to version 1 when v1 will be release ? tnx @kbrsh |
You can use a loop. const components = ["foo", "bar", "baz"];
for (let i = 0; i < components.length; i++) {
require("./components/" + components[i] + ".js")(Moon);
} I'm rewriting v1 and the alpha will be released very soon (around next week). Check out the rewrite branch for my current progress and join the Slack where I regularly post updates. |
A few days ago I saw a video about vue-cli
here the codes in video:
Message.vue
can we use
components: { }
for naming the components in moon templates ??and something i see in video he wrapp all the thing to
App.vue
insead ofindex.html
App.vue
how can we use
App.moon
insead of rendering them in HTML fileMain.js
The text was updated successfully, but these errors were encountered: