如何在公共文件夹中包含vue-component(Laravel 5.5)

时间:2018-03-22 14:54:50

标签: vue.js laravel-5.5

我有一个带有下一个代码的刀片文件

<div id="appCropper">
    <cropper-admin></cropper-admin>
</div>

和js文件

let Child = {
    template: '<div>test</div>'
};


new Vue({
    el: '#appCropper',
    components: {
        'cropper-admin' : Child
    }
});

当我尝试在控制台中使用“require(js / component.vue”)时,我会看到

  

未捕获的ReferenceError:未定义require

1 个答案:

答案 0 :(得分:0)

参考文献:

在app.js(条目文件)中:

全球注册:

<template>
 <div>{{ text }}</div>
</template>

<script>
 export default {
   data() {
  return { text: 'test }
  }
}
</script>

本地注册:

string MyPath = @"D:/Documents/Reonance Tunneling";

component.vue:

private void BntDeleteFolder_Click(object sender, EventArgs e)
    {
        TreeNode newSelected = TreeView1.SelectedNode;
        string DirectoryName = newSelected.Text;
        DirectoryInfo nodeDirInfo = (DirectoryInfo)newSelected.Tag;

        try
        {
            if (MessageBox.Show("Are you sure you want to delete Folder " + "'" + DirectoryName + "'" + " ?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                foreach (FileInfo file in nodeDirInfo.GetFiles())
                {
                    File.Delete(MyPath + "//" + DirectoryName + "//" + item.Text);
                 }                  

                Directory.Delete(MyPath + "//" + DirectoryName + "//");
                newSelected.Remove();
            }

        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }

希望这有助于您入门