Skip to content

Commit

Permalink
add react kalamell.jsx (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalamell authored Oct 20, 2023
1 parent e8b35ba commit 4aa9334
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Reactjs/Kalamell.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//AUTHOR:Kalamell
//Language:JS , LIBRARY:ReactJS
//Github link:https://github.com/kalamell



import {useState} from 'react';


function App() {
const [text, setText] = useState('Coffee');

function handleClick(){
if (text === 'Coffee'){
setText('Code');
} else{
setText('Coffee')
}

}
return (
<div className="App">
<header>
<h1>REACT JS CHANGING BUTTON</h1>
<h2>{text}</h2>
<button onClick={handleClick} className="doublechange">Click to change</button>

</header>
</div>
);
}

export default App;
18 changes: 18 additions & 0 deletions Vue/Kalamell.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<button @click="convertCoffeeToCode">{{ text }}</button>
</template>

<script>
export default {
name: "convertcoffeetocode",
data: () => ({
text: "coffee",
}),
methods: {
convertCoffeeToCode() {
this.text = this.text.replace("coffee", "code");
},
},
};
</script>

0 comments on commit 4aa9334

Please sign in to comment.