私はspectacle-code-slideをプレゼンテーションに使用しようとしています。現在、何かをレンダリングすることができませんでした。 (1)spectacle-code-slideはレンダリングしません
import React from 'react';
import { Spectacle, Deck } from 'spectacle';
import CodeSlide from 'spectacle-code-slide';
export default class Presentation extends React.Component {
render() {
return (
<Spectacle theme={theme}>
<Deck transition={[]} transitionDuration={0} progress="bar">
// ...
<CodeSlide
transition={[]}
lang="js"
code={require("raw!../assets/code.example")}
ranges={[
{ loc: [0, 270], title: "Walking through some code" },
{ loc: [0, 1], title: "The Beginning" },
{ loc: [1, 2] },
{ loc: [1, 2], note: "Heres a note!" },
{ loc: [2, 3] },
{ loc: [4, 7] },
{ loc: [8, 10] },
// ...
]}/>
// ...
</Deck>
</Spectacle>
);
}
}
すなわち、
1クローン化spectacle-boilerplate
2の眼鏡コード-スライドの "使用方法" のセクションでのコードでデフォルト/presentation/index.js
を置き換え:ここに私がやっていることです3 Ran npm install
、続いてnpm install --save spectacle-code-slide
。
4(1)〜assets/code.example
が追加されました。
5ランnpm start
。
私が得た:
Listening at http://localhost:3000
webpack built 966ffe50dc640fdaec4a in 4726ms
はlocalhost:3000
をチェックし、唯一の空白のページがあります。その他のエラーは報告されません。何が起こっている?
これらの '// ...'権利を削除しますか? –