FranckFreiburger / http-vue-loader

load .vue files from your html/js
MIT License
1.48k stars 273 forks source link

Why Example code fail to work? #99

Closed BurningUnder closed 3 years ago

BurningUnder commented 4 years ago

I'm using example code and it fails to work,

here is the folder: root

here is the bug report(when I open the index.html from folder using chrome: bug1 bug2

here is the code(copy from the example):

<!doctype html>
<html lang="en">
  <head>
    <script src="https://unpkg.com/vue"></script>
    <script src="https://unpkg.com/http-vue-loader"></script>
  </head>

  <body>
    <div id="my-app">
      <my-component></my-component>
    </div>

    <script type="text/javascript">
      new Vue({
        el: '#my-app',
        components: {
          'my-component': httpVueLoader('my-component.vue')
        }
      });
    </script>
  </body>
</html>
<template>
    <div class="hello">Hello {{who}}</div>
</template>

<script>
module.exports = {
    data: function() {
        return {
            who: 'world'
        }
    }
}
</script>

<style>
.hello {
    background-color: #ffe;
}
</style>
BurningUnder commented 4 years ago

It's fixed , sorry that I didn't see this,I using Chrome 79.0.3945.117ver fix

BurningUnder commented 4 years ago

maybe someone will forget this too, so I reopen it

xiongmao86 commented 3 years ago

Is a webserver really optional? Since you have to run express to get vue component loaded?