You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by wu...@apache.org on 2019/11/22 08:27:38 UTC
[skywalking-rocketbot-ui] branch master updated: Component: back
component (#206)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-rocketbot-ui.git
The following commit(s) were added to refs/heads/master by this push:
new 50f20db Component: back component (#206)
50f20db is described below
commit 50f20db35206b49379b0e52d7ee5d7d0b64f02d3
Author: bigflybrother <fe...@daocloud.io>
AuthorDate: Fri Nov 22 16:27:32 2019 +0800
Component: back component (#206)
* add
* 修改
---
src/components/index.ts | 6 ++++--
src/components/rk-back.vue | 50 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/src/components/index.ts b/src/components/index.ts
index 3724e1a..4345f11 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -28,11 +28,13 @@ import RkEcharts from './rk-echarts.vue';
import RkSelect from './rk-select.vue';
import RkPopper from './rk-popper.vue';
import RkDropdown from './rk-dropdown.vue';
+import RkBack from './rk-back.vue';
const components: any = {
- RkHeader, RkFooter, RkProgress, RkDate, RkPanel, RkEcharts, RkPage, RkSidebox, RkFooterTime, RkSelect, RkPopper,
- RkDropdown,
+ RkHeader, RkFooter, RkProgress, RkDate, RkPanel, RkEcharts, RkPage, RkSidebox, RkFooterTime, RkSelect,
+ RkPopper, RkDropdown, RkBack,
};
+
const componentsName: string[] = Object.keys(components);
export default {install: (vue: any) => {
componentsName.forEach((i) => {
diff --git a/src/components/rk-back.vue b/src/components/rk-back.vue
new file mode 100644
index 0000000..51ccf9f
--- /dev/null
+++ b/src/components/rk-back.vue
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+<template>
+ <a class="rk-back" @click="handleBack">
+ <svg class="icon"><use xlink:href="#chevron-left"></use></svg>
+ </a>
+</template>
+<script lang="ts">
+import Vue from 'vue';
+import { Component, Prop } from 'vue-property-decorator';
+
+@Component
+export default class RkBack extends Vue {
+ @Prop({ default: '' }) private size!: string;
+ private handleBack() {
+ const query = this.$route.query as any;
+ if (query.form) {
+ this.$router.push(query.form);
+ } else {
+ this.$emit('back');
+ }
+ }
+}
+</script>
+<style lang="scss">
+.rk-back{
+ margin-right: 10px;
+ .icon{
+ vertical-align: bottom;
+ height: 22px;
+ width: 22px;
+ padding: -1px 3px;
+ }
+}
+</style>