question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A few days ago I saw a video about vue-cli

here the codes in video:

Message.vue

<template>
  <div>
    <h1>This is Great Message</h1>
    <app-input></app-input>
  </div>
</template>
<script>
  import Input from './component/Input.vue'
  export default {
    components: {
      'app-input': Input
    }
  }
</script>

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 of index.html

App.vue

<template>
  <div id="app">
    <h1>{{ message }}</h1>
    <app-message></app-message>
  </div>
</template>
<script>

export default {
  name: 'app',
  data: function() {
    return {
        message: "this is message"
    }
  }
}
</script>

how can we use App.moon insead of rendering them in HTML file

Main.js

import Vue from 'vue';
import App from './App.vue';
import Message from './Message';

Vue.component('app-message', Message);

new Vue({
  el: '#app',
  render: h => h(App)
})

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kbrshcommented, Jun 29, 2018

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.

1reaction
kbrshcommented, Jun 21, 2018

Just require all your component in scripts.js like the default template of Moon CLI does.

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.
Read more comments on GitHub >

github_iconTop Results From Across the Web

TK Custom FAQ's | How to Use Moon Clips for Revolvers
Do you have questions about moon clips? Visit the TK Custom FAQ page to learn more about fitment and how you can use...
Read more >
TK custom moonclip question - Revolver Forum - Brian Enos's ...
The section for starline brass says: Starline 357 magnum. (Not new brass. ) What does not new brass mean? Will these work ok...
Read more >
Moonclip question - Page 1 - AR15.COM
It's what I am currently using for my rimless moonclips. To unload them you can use the Moonclip Tool there is a demooner...
Read more >
How to load and unload a Moon Clip for a Revolver - YouTube
COL and Pressure: Viewer Question. TRD Reloading. TRD Reloading ... moon clip loader moonclip loader. Phillippians 4:6. Phillippians 4:6.
Read more >
Customer Questions - Amazon.com
Q: If used in pocket it wont damage the moon clip? Using this carrier will not damage the moonclip when its in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found