| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <template>
- <div>
- <h3>Java 源代码</h3>
- <prism language="java">{{ sourceCode }}</prism>
- </div>
- </template>
- <script>
- import Prism from 'vue-prism-component'
- import 'prismjs'
- import 'prismjs/themes/prism.css'
- import 'prismjs/components/prism-java'
- export default {
- name: 'SourceCode',
- components: {
- Prism
- },
- data () {
- return {
- sourceCode: `public class MyArray {
- MyArray next;
- char[] letters;
- int[][] nums;
- MyArray[][] refs;
- public static void main(String[] args) {
- MyArray a = new MyArray();
- a.next = new MyArray();
- a.letters = new char[10];
- a.nums = new int[4][5];
- a.nums[2][2] = 1;
- a.refs = new MyArray[3][3];
- a.refs[1][1] = new MyArray();
- }
- }
- `
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- pre {
- background: none;
- padding: 0;
- }
- code {
- background: none !important;
- box-shadow: none !important;
- }
- </style>
|