12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <template>
- <div>
- <canvas id="radialGradient2" width="740" height="400" tabindex="0"/>
- </div>
- </template>
- <script>
- import { SGraphScene, SGraphView } from "@persagy-web/graph/lib";
- import { SRadialGradient } from "@persagy-web/draw/lib";
- import {GradRect} from "./GradRect";
- export default {
- name: "radialGradient1",
- data(){
- return {
- view: ''
- }
- },
- mounted() {
- this.init();
- },
- methods:{
- init(){
- this.view = new SGraphView('radialGradient2');
- const scene = new SGraphScene();
- const grad = new SRadialGradient(
- 250,
- 250,
- 50, //圆1半径
- 500,
- 500,
- 500 //圆2半径
- );
- const item = new GradRect(null, grad);
- scene.addItem(item);
- this.view.scene = scene;
- this.view.fitSceneToView();
- this.view.scalable = false;
- }
- }
- }
- </script>
- <style scoped>
- </style>
|