Home > front end >  Vue making connections
Vue making connections

Time:11-04

What a great god can bump of busy, vue make effect on the figure, wired on both ends of the text box can put a picture or text

CodePudding user response:

Draw a line with SVG

CodePudding user response:

This is the problem the Vue

No, this is the CSS

CodePudding user response:

 



<meta charset="UTF-8">
<link rel="stylesheet" href="https://rawcdn.githack.com/cn00439805/start/bd22508bbb39ce230a4c968df59450dcb0dfad6c/jquery-ui.min.css" & gt;
<link rel="stylesheet" href="https://rawcdn.githack.com/cn00439805/start/bd22508bbb39ce230a4c968df59450dcb0dfad6c/jquery.flowchart.css" & gt;
<script SRC="https://rawcdn.githack.com/cn00439805/start/ece0b26d895deb28c70619c6d35ed1f14c373fe3/jquery-1.10.2.js" & gt; </script>
<script SRC="https://rawcdn.githack.com/cn00439805/start/4e087012ba83ccdda94e3312f2befdfc740145d4/jquery-ui.min.js" & gt; </script>
<script SRC="https://rawcdn.githack.com/cn00439805/start/c4919370f57a125b2f00cc1ff4381ff53cee7046/jquery.flowchart.js" & gt; </script>
<script SRC="https://unpkg.com/vue/dist/vue.js" & gt; </script>
<style>
The container {width: 502 px; Height: 702 px; background:#fff; }
. The flowchart - operator. The flowchart - operator - the title {display: none; }
The flowchart - operator {width: 100 px; Height: 30 px; Padding: 35 0 px; Background - size: contain; }
</style>

<body>




<script>
The function broadcast (the componentName, eventName, params) {this. $children. ForEach (child=& gt; {var name=child.$options.com ponentName; If (name===the componentName) {child. $emit. The apply (child, [eventName] concat (params)); } else {broadcast. Apply (child, [the componentName, eventName]. Concat ([params])); }}); }
Var Emitter={the methods: {dispatch (the componentName, eventName, params) {var parent=this. $parent | | this. $root; Var name=parent.$options.com ponentName; While (parent& & (! The name | | name!==the componentName)) {parent=parent. $parent; If (the parent) {name=parent.$options.com ponentName; }}
If (the parent) {parent. $emit. The apply (parent, [eventName] concat (params)); }}, broadcast (the componentName, eventName, params) {broadcast. Call (this, the componentName, eventName, params); }}}
Var MyItem={
Name: 'MyItem'
The componentName: 'MyItem',
Mixins: [Emitter],
The template: '& lt; Div>
'
Props: {
Image: {
Type: String,
Default: "https://center.mvcx.net/web/img/a0.jpg"
},
Left: {
Type: Number
},
Top: {
Type: Number
},
Type: {
Type: String,
Default: "output",
},
},
Created () {
This. $on (' MyItemContainerMounted '(parentComp parentEl)=& gt; {
Var inputs={}, outputs={}; If (this. Type==="input") {inputs (" a ")={label: ""}}
If (this. Type==="output") {outputs (" b ")={label: ""}}
Var data=https://bbs.csdn.net/topics/{left: this left, top: this. Top, the properties: {inputs, outputs,},}; Var index=parentEl. Flowchart (' addOperator, data); Var $el=parentEl. Find (" flowchart - operator "). The eq (index)
$el. CSS (" background - image ", ` url (' ${. This image}) `)
});
}
}
Var MyItemContainer={
Name: 'MyItemContainer'
The componentName: 'MyItemContainer',
Mixins: [Emitter],
The template: '& lt; Div>
'
Data () {
Return {
El: null,
}
},
Methods: {
The init () {
Var $el=$(enclosing $el)
$el. Flowchart ()
This broadcast (' MyItem ', 'MyItemContainerMounted, [this, $el]);
}
},
Mounted () {
If (document. The readyState==="loading") {
$(function () {
Enclosing the init ()
}. The bind (this))
}
The else {
Enclosing the init ()
}
}
}
Var=new vm Vue ({
El: '# app,
Data: the function () {
Return {
The items: [
{left: 0, top: 0, type: "output"},
{image: "https://file5.mvcx.net/files/1000/2019129/21b813aa-741e-40b8-a0c1-9751119dab52.png", left: 400, top: 0, type: "input"},
{left: 0, top: 200, type: "output"},
{image: "https://file5.mvcx.net/files/1000/2019129/acf72003-6623-494b-83d8-07ab3b5ba4db.png", left: 400, top: 200, type: "input"},
{left: 0, top: 400, type: "output"},
{image: "https://file5.mvcx.net/files/1000/2019129/acf72003-6623-494b-83d8-07ab3b5ba4db.png", left: 400, top: 400, type: "input"},
{left: 0, top: 600, type: "output"},
{image: "https://file5.mvcx.net/files/1000/2019129/21b813aa-741e-40b8-a0c1-9751119dab52.png", left: 400, top: 600, type: "input"}
]
}
},
Components: {
MyItemContainer,
MyItem
},
})
</script>

CodePudding user response:

Don't mention it, I am a lei fengnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related