我正在使用 6.0.2 版本的 rails 构建一个 RoR 应用程序。我需要在我的项目中使用 Fullcalendar.io:
到目前为止:
yarn add @fullcalendar/core @fullcalendar/daygrid @fullcalendar/list
Run Code Online (Sandbox Code Playgroud)
在我的 application.js 文件中:
window.Calendar = require("@fullcalendar/core").Calendar;
window.dayGridPlugin = require("@fullcalendar/daygrid").default;
window.listPlugin = require("@fullcalendar/list").default;
Run Code Online (Sandbox Code Playgroud)
在我的 pages.scss 文件中:
@import '@fullcalendar/core/main.css';
@import '@fullcalendar/daygrid/main.css';
@import '@fullcalendar/list/main.css';
Run Code Online (Sandbox Code Playgroud)
在我的 calendar.html.erb 页面中:
<section class="section">
<div class="container m-t-20">
<div id="calendar"></div>
</div>
</section>
<script>
$(function() {
var calendarEl = document.getElementById('calendar');
var calendar = new Calendar(calendarEl, {
header: {
left: 'prev,next',
right: 'dayGridMonth, listMonth'
},
plugins: [ dayGridPlugin, listPlugin ],
defaultView: 'dayGridMonth'
});
calendar.render();
});
</script>
Run Code Online (Sandbox Code Playgroud)
启动应用程序后,我可以在日历页面中看到日历中的日期和信息,但没有 …
在语言环境(使用 Chrome 的 Ubuntu 18.04)上运行 Ruby on Rails 6 应用程序时,出现以下错误:
Uncaught (CardanoSerializationLib.ts:15 in promise) CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0
Run Code Online (Sandbox Code Playgroud)
和
GET http://localhost:3000/wasm/csl-v10.0.4.wasm 404 (Not Found)
Run Code Online (Sandbox Code Playgroud)
和
`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:
TypeError: Failed to execute 'compile' on 'WebAssembly': HTTP status code is not ok
Run Code Online (Sandbox Code Playgroud)
似乎它正在影响 webpacker,并且无法渲染我的页面。