2023-11-30 08:12:59 +02:00
|
|
|
<template>
|
|
|
|
<h2 class="tool-title">Str to lower/upper</h2>
|
|
|
|
<hr class="mt-5 mb-5">
|
|
|
|
|
|
|
|
<div class="input-group">
|
|
|
|
<label for="data">Data</label>
|
2024-03-07 13:41:39 +02:00
|
|
|
<textarea id="data" v-model="toolData.data" v-on:keyup="result"></textarea>
|
2023-11-30 08:12:59 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="input-group">
|
|
|
|
<label>Mode</label>
|
|
|
|
|
|
|
|
<div>
|
2024-03-07 13:41:39 +02:00
|
|
|
<input id="case_mode_lower" value="lower" name="case_mode" v-model="toolData.caseMode" v-on:change="result" type="radio"> <label for="case_mode_lower">to lower</label><br>
|
|
|
|
<input id="case_mode_upper" value="upper" name="case_mode" v-model="toolData.caseMode" v-on:change="result" type="radio"> <label for="case_mode_upper">to upper</label>
|
2023-11-30 08:12:59 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr class="mt-5 mb-5">
|
|
|
|
|
|
|
|
<div class="input-group">
|
|
|
|
<label for="result">Result</label>
|
2024-03-07 13:41:39 +02:00
|
|
|
<MonacoEditor name="result" language="text" :value="toolResult"></MonacoEditor>
|
2023-11-30 08:12:59 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-03-07 13:41:39 +02:00
|
|
|
import MonacoEditor from "@/components/MonacoEditor.vue";
|
|
|
|
|
2023-11-30 08:12:59 +02:00
|
|
|
export default {
|
2024-03-07 13:41:39 +02:00
|
|
|
components: {
|
|
|
|
MonacoEditor
|
|
|
|
},
|
2023-11-30 08:12:59 +02:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
toolData: {
|
|
|
|
data: '',
|
|
|
|
caseMode: 'upper',
|
|
|
|
},
|
2024-03-07 13:41:39 +02:00
|
|
|
toolResult: '',
|
2023-11-30 08:12:59 +02:00
|
|
|
};
|
|
|
|
},
|
2024-03-07 13:41:39 +02:00
|
|
|
methods: {
|
|
|
|
result() {
|
2023-11-30 08:12:59 +02:00
|
|
|
switch (this.toolData.caseMode) {
|
|
|
|
case 'lower':
|
2024-03-07 13:41:39 +02:00
|
|
|
this.toolResult = this.toolData.data.toLocaleLowerCase();
|
|
|
|
break;
|
2023-11-30 08:12:59 +02:00
|
|
|
case 'upper':
|
2024-03-07 13:41:39 +02:00
|
|
|
this.toolResult = this.toolData.data.toLocaleUpperCase();
|
|
|
|
break;
|
2023-11-30 08:12:59 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
</style>
|